package com.anan.controller;

import com.anan.constants.Constants;
import com.anan.pojo.dto.OssPolicyResult;
import com.anan.service.OssService;
import com.anan.utils.ComResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@RequestMapping("/aliyun/oss")
public class OssController {

    @Autowired
    private OssService ossService;


    @GetMapping("/policy")
    public ComResult policy(){
        ComResult comResult = new ComResult();
         OssPolicyResult ossPolicyResult = ossService.policy();
         comResult.setData(ossPolicyResult);
         comResult.setCode(Constants.RET_CODE.SUCCESS);
         return comResult;
    }
}
